<?php namespace Summer\Hjd\Models;

use Model;

/**
 * Model
 */
class RgRuleModel extends Model
{
    use \Winter\Storm\Database\Traits\Validation;
    

    /**
     * @var string The database table used by the model.
     */
    public $table = 'summer_hjd_rg_rule';

    /**
     * @var array Validation rules
     */
    public $rules = [
        'currency_slug' => 'required|between:2,255|unique:summer_hjd_rg_rule',
    ];
    public $belongsTo = [
        'currency' => ['Summer\Hjd\Models\CurrencyModel', 'key' => 'currency_slug', 'otherKey' => 'slug']
    ];

    public function getCurrencySlugOptions()
    {
        return CurrencyModel::where('status',1)->pluck('title','slug');
    }
}
